<?php
$this->title = $type == "new" ? "增加栏目" : "修改栏目";
?>
<div class="main">
	<div class="header"><?=$this->title?></div>
	<div class="form-container">
		<form id="category-form" class="form-horizontal" action="<?=ROOT_URL?>article/<?= $type == "new" ? "catadd" : "catmodify"?>" method="post">
			<input name='id' type='hidden' value="<?=$category['id']?>">
			
			<div class="form-group">
				<label class="col-sm-2 control-label">栏目名称</label>
				<div class="col-sm-4">
					<input id="categroyname" type="text" class="form-control" name="name" value="<?=$category['name']?>">
				</div>
				<label class="col-sm-2 control-label">栏目顺序</label>
				<div class="col-sm-4">
					<input id="categoryorder" type="text" class="form-control" name="order" value="<?=$category['order']?>">
				</div>
			</div>
			
		 	<div class="form-group">
				<label class="col-sm-4 control-label"></label>
				<div class="col-sm-4">
					<input id="submitbtn" type="button" class="btn btn-primary col-sm-4" value="确定" style="margin-right:40px">
					<a href="<?=ROOT_URL?>article/category" class="btn btn-danger col-sm-4">返回</a>
				</div>
			</div> 
		</form>
	</div>
<div>
<script type="text/javascript">
$("#submitbtn").click(function(){
	if($.trim($("#categroyname").val()) == "")
	{
		alert("请输入栏目名称");
	}else
	{
		$("#category-form").submit();
	}
	
});

</script>
